<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>试卷列表</title>
<style type="text/css">
body{
  margin: 6px;
  padding: 0;
  font-size: 12px;
  font-family: tahoma, arial;
  background: #fff;
}

table{
  width: 100%;
}
tr.odd{
  background: #fff;
 }
 tr.even{
  background: #eee;
}

div.datagrid_div{
 width: 100%;
 border: 1px solid #999;
}

/*****************样式1*******************/
 table.datagrid1{
  border-collapse: collapse;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 th{
  color: #333;
  padding: 3px;
  font-family: monospace;
  background: #9cf;
  text-align: center;
  border-top: 1px solid #666;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 td{
  padding: 3px;
  border-top: 1px solid #ccc;
 }

 tr:hover,
 tr.hover{
  background: #9cf;
 }
 </style>
<script type="text/javascript">
function add_event(tr){
	   tr.onmouseover = function(){
	    tr.className += ' hover';
	   };
	   tr.onmouseout = function(){
	    tr.className = tr.className.replace(' hover', '');
	   };
	  }

	  function stripe(table) {
	   var trs = table.getElementsByTagName("tr");
	   for(var i=1; i<trs.length; i++){
	    var tr = trs[i];
	    tr.className = i%2 != 0? 'odd' : 'even';
	    add_event(tr);
	   }
	  }

	  window.onload = function(){
	   var tables = document.getElementsByTagName('table');
	   for(var i=0; i<tables.length; i++){
	    var table = tables[i];
	    table.className="datagrid1";
	    stripe(tables[i]);
	   }
	  } 
</script>
</head>
<body>
<div><b>您现在的位置是：考生管理 &gt;&gt;试卷管理</b><button style="float: right;" onclick = "location.href='paper.action?action=add'" >添加试卷</button></div>
<div style="margin: 0.3em;">
<form action="paper.action" method="post" >
	<input type="hidden" name="action" value="search" />
	试卷名称：<input type="text" name="name"/> <input type="submit" value="查询" onclick="document.getElementsByTagName('jsp:include').page='../../commons/Pagelist1.jsp'" />
	<a href="paper.action?action=list" onclick="document.getElementsByTagName('jsp:include').page='../../commons/Pagelist.jsp'" >全部试卷信息</a> 
</form>
</div>
<table cellspacing="1" border="0" style="color:#333333;width:100%;" align="center">
<tr class="GridHeader" style="height: 25px;">
	<th>编号</th>
	<th>试卷名称</th>
	<th>出题方式</th>
	<th>操作</th>
	</tr>
	
	<s:if test="%{paperList.size()!=0}">
		<s:iterator value="%{paperList}" id="paper" status="status">
		<tr>
		<td>&nbsp;<s:property value="#status.count"/></td>
		<td><s:property value="#paper.name"/></td>
		<td>随机出题</td>
		<td>
		<input type="button" value="修改" onclick="location.href='paper.action?action=edit&id=<s:property value="#paper.id"/>'"/>
		<input type="button" value="预览" onclick="location.href='paper.action?action=view&id=<s:property value="#paper.id"/>'"/>
		<input type="button" value="删除" onclick="location.href='paper.action?action=del&id=<s:property value="#paper.id"/>'"/>
		</td>
		</tr>
		</s:iterator>
		</s:if>
		<s:else>
			<tr>
				<td align="center" width="100%" colspan="4">
					无任何试卷信息！
				</td>
			</tr>
		</s:else>
</table>
<br />
<!-- 分页部分 -->
<div id="page">
	<jsp:include page="../../commons/Pagelist.jsp"/>
</div>
</body>
</html>